MATRND

Syntax: MATRND array     
    or: MATRND array% [[ ,minval%] ,maxval%]
Location: Math Package

This command initialises all of the elements of an integer or floating point array with random numbers. Their default range depends on the type of array: for integer arrays, the values range from -32768 to 32767, whereas for floating point they range between 0 and 1.

MATRND selects the range itself if there is just one parameter, but for integer arrays only, an extended syntax allows you to specify another range (as in the second variant). If just a maximum value maxval% is specified then values range from 0 to maxval%, if a minimum minval% is additionally given then values range from minval% to maxval%.

Example:
DIM array(1,2)
MATRND array   

WARNING:
MATRND allows a string array as a parameter. This leads to odd results and can possibly hang the machine.

CROSS-REFERENCE:
The random values chosen by MATRND can be influenced by RANDOMISE.
